home *** CD-ROM | disk | FTP | other *** search
- on Blink blinkSpeed
- puppetSprite(21, 1)
- repeat with i = 1 to 5
- set the castNum of sprite 21 to the castNum of sprite 21 - 1
- updateStage()
- wait(blinkSpeed)
- end repeat
- wait(blinkSpeed * 3)
- repeat with i = 1 to 5
- set the castNum of sprite 21 to the castNum of sprite 21 + 1
- updateStage()
- wait(blinkSpeed)
- end repeat
- puppetSprite(21, 0)
- end
-
- on starteye
- global lastBlink, nextBlink
- puppetSprite(11, 1)
- set lastBlink to the ticks
- set nextBlink to 14 + random(286)
- end
-
- on moveEye
- set x1 to (the mouseH - 291) * 1.0
- set y1 to (the mouseV - 186) * 1.0
- if ((x1 * x1) + (y1 * y1)) <= 729 then
- set x2 to x1
- set y2 to y1
- else
- if y1 = 0 then
- set y2 to 0
- if x1 > 27 then
- set x2 to 27
- else
- if x1 < -27 then
- set x2 to -27
- end if
- end if
- else
- set y2 to sqrt(729 / ((x1 * x1 / (y1 * y1)) + 1))
- if y1 < 0 then
- set y2 to -y2
- end if
- set x2 to x1 * y2 / y1
- end if
- end if
- set the locH of sprite 11 to 291 + x2
- set the locV of sprite 11 to 186 + y2
- randomBlink()
- end
-
- on randomBlink
- global lastBlink, nextBlink
- if (the ticks - lastBlink) >= nextBlink then
- if (random(2) mod 2) = 0 then
- Blink(0)
- else
- Blink(1)
- end if
- set lastBlink to the ticks
- set nextBlink to 14 + random(226)
- end if
- end
-
- on wait ticks
- set temp to the ticks
- repeat while (the ticks - temp) < ticks
- end repeat
- end
-